<?php


/*
* Copyright (c) 2008-2016 vip.com, All Rights Reserved.
*
* Powered by com.vip.osp.osp-idlc-2.5.11.
*
*/

namespace com\vip\wpc\ospservice\vop\request;

class WpcMultiChannelH5LoginOrRegRequest {
	
	static $_TSPEC;
	public $areaId = null;
	public $timestamp = null;
	public $vopChannelId = null;
	public $userNumber = null;
	public $h5ChannelId = null;
	public $openId = null;
	public $mid = null;
	public $ip = null;
	public $redirectPagePath = null;
	public $phone = null;
	public $phoneCipher = null;
	public $avator = null;
	public $nickName = null;
	
	public function __construct($vals=null){
		
		if (!isset(self::$_TSPEC)){
			
			self::$_TSPEC = array(
			501 => array(
			'var' => 'areaId'
			),
			502 => array(
			'var' => 'timestamp'
			),
			503 => array(
			'var' => 'vopChannelId'
			),
			504 => array(
			'var' => 'userNumber'
			),
			201 => array(
			'var' => 'h5ChannelId'
			),
			202 => array(
			'var' => 'openId'
			),
			203 => array(
			'var' => 'mid'
			),
			204 => array(
			'var' => 'ip'
			),
			207 => array(
			'var' => 'redirectPagePath'
			),
			208 => array(
			'var' => 'phone'
			),
			209 => array(
			'var' => 'phoneCipher'
			),
			210 => array(
			'var' => 'avator'
			),
			211 => array(
			'var' => 'nickName'
			),
			
			);
			
		}
		
		if (is_array($vals)){
			
			
			if (isset($vals['areaId'])){
				
				$this->areaId = $vals['areaId'];
			}
			
			
			if (isset($vals['timestamp'])){
				
				$this->timestamp = $vals['timestamp'];
			}
			
			
			if (isset($vals['vopChannelId'])){
				
				$this->vopChannelId = $vals['vopChannelId'];
			}
			
			
			if (isset($vals['userNumber'])){
				
				$this->userNumber = $vals['userNumber'];
			}
			
			
			if (isset($vals['h5ChannelId'])){
				
				$this->h5ChannelId = $vals['h5ChannelId'];
			}
			
			
			if (isset($vals['openId'])){
				
				$this->openId = $vals['openId'];
			}
			
			
			if (isset($vals['mid'])){
				
				$this->mid = $vals['mid'];
			}
			
			
			if (isset($vals['ip'])){
				
				$this->ip = $vals['ip'];
			}
			
			
			if (isset($vals['redirectPagePath'])){
				
				$this->redirectPagePath = $vals['redirectPagePath'];
			}
			
			
			if (isset($vals['phone'])){
				
				$this->phone = $vals['phone'];
			}
			
			
			if (isset($vals['phoneCipher'])){
				
				$this->phoneCipher = $vals['phoneCipher'];
			}
			
			
			if (isset($vals['avator'])){
				
				$this->avator = $vals['avator'];
			}
			
			
			if (isset($vals['nickName'])){
				
				$this->nickName = $vals['nickName'];
			}
			
			
		}
		
	}
	
	
	public function getName(){
		
		return 'WpcMultiChannelH5LoginOrRegRequest';
	}
	
	public function read($input){
		
		$input->readStructBegin();
		while(true){
			
			$schemeField = $input->readFieldBegin();
			if ($schemeField == null) break;
			$needSkip = true;
			
			
			if ("areaId" == $schemeField){
				
				$needSkip = false;
				$input->readString($this->areaId);
				
			}
			
			
			
			
			if ("timestamp" == $schemeField){
				
				$needSkip = false;
				$input->readString($this->timestamp);
				
			}
			
			
			
			
			if ("vopChannelId" == $schemeField){
				
				$needSkip = false;
				$input->readString($this->vopChannelId);
				
			}
			
			
			
			
			if ("userNumber" == $schemeField){
				
				$needSkip = false;
				$input->readString($this->userNumber);
				
			}
			
			
			
			
			if ("h5ChannelId" == $schemeField){
				
				$needSkip = false;
				$input->readString($this->h5ChannelId);
				
			}
			
			
			
			
			if ("openId" == $schemeField){
				
				$needSkip = false;
				$input->readString($this->openId);
				
			}
			
			
			
			
			if ("mid" == $schemeField){
				
				$needSkip = false;
				$input->readString($this->mid);
				
			}
			
			
			
			
			if ("ip" == $schemeField){
				
				$needSkip = false;
				$input->readString($this->ip);
				
			}
			
			
			
			
			if ("redirectPagePath" == $schemeField){
				
				$needSkip = false;
				$input->readString($this->redirectPagePath);
				
			}
			
			
			
			
			if ("phone" == $schemeField){
				
				$needSkip = false;
				$input->readString($this->phone);
				
			}
			
			
			
			
			if ("phoneCipher" == $schemeField){
				
				$needSkip = false;
				$input->readString($this->phoneCipher);
				
			}
			
			
			
			
			if ("avator" == $schemeField){
				
				$needSkip = false;
				$input->readString($this->avator);
				
			}
			
			
			
			
			if ("nickName" == $schemeField){
				
				$needSkip = false;
				$input->readString($this->nickName);
				
			}
			
			
			
			if($needSkip){
				
				\Osp\Protocol\ProtocolUtil::skip($input);
			}
			
			$input->readFieldEnd();
		}
		
		$input->readStructEnd();
		
		
		
	}
	
	public function write($output){
		
		$xfer = 0;
		$xfer += $output->writeStructBegin();
		
		if($this->areaId !== null) {
			
			$xfer += $output->writeFieldBegin('areaId');
			$xfer += $output->writeString($this->areaId);
			
			$xfer += $output->writeFieldEnd();
		}
		
		
		if($this->timestamp !== null) {
			
			$xfer += $output->writeFieldBegin('timestamp');
			$xfer += $output->writeString($this->timestamp);
			
			$xfer += $output->writeFieldEnd();
		}
		
		
		if($this->vopChannelId !== null) {
			
			$xfer += $output->writeFieldBegin('vopChannelId');
			$xfer += $output->writeString($this->vopChannelId);
			
			$xfer += $output->writeFieldEnd();
		}
		
		
		if($this->userNumber !== null) {
			
			$xfer += $output->writeFieldBegin('userNumber');
			$xfer += $output->writeString($this->userNumber);
			
			$xfer += $output->writeFieldEnd();
		}
		
		
		if($this->h5ChannelId !== null) {
			
			$xfer += $output->writeFieldBegin('h5ChannelId');
			$xfer += $output->writeString($this->h5ChannelId);
			
			$xfer += $output->writeFieldEnd();
		}
		
		
		if($this->openId !== null) {
			
			$xfer += $output->writeFieldBegin('openId');
			$xfer += $output->writeString($this->openId);
			
			$xfer += $output->writeFieldEnd();
		}
		
		
		if($this->mid !== null) {
			
			$xfer += $output->writeFieldBegin('mid');
			$xfer += $output->writeString($this->mid);
			
			$xfer += $output->writeFieldEnd();
		}
		
		
		if($this->ip !== null) {
			
			$xfer += $output->writeFieldBegin('ip');
			$xfer += $output->writeString($this->ip);
			
			$xfer += $output->writeFieldEnd();
		}
		
		
		if($this->redirectPagePath !== null) {
			
			$xfer += $output->writeFieldBegin('redirectPagePath');
			$xfer += $output->writeString($this->redirectPagePath);
			
			$xfer += $output->writeFieldEnd();
		}
		
		
		if($this->phone !== null) {
			
			$xfer += $output->writeFieldBegin('phone');
			$xfer += $output->writeString($this->phone);
			
			$xfer += $output->writeFieldEnd();
		}
		
		
		if($this->phoneCipher !== null) {
			
			$xfer += $output->writeFieldBegin('phoneCipher');
			$xfer += $output->writeString($this->phoneCipher);
			
			$xfer += $output->writeFieldEnd();
		}
		
		
		if($this->avator !== null) {
			
			$xfer += $output->writeFieldBegin('avator');
			$xfer += $output->writeString($this->avator);
			
			$xfer += $output->writeFieldEnd();
		}
		
		
		if($this->nickName !== null) {
			
			$xfer += $output->writeFieldBegin('nickName');
			$xfer += $output->writeString($this->nickName);
			
			$xfer += $output->writeFieldEnd();
		}
		
		
		$xfer += $output->writeFieldStop();
		$xfer += $output->writeStructEnd();
		return $xfer;
	}
	
}

?>